function dragCell(graph,cells,x,y,target,event){
	graph.getModel().beginUpdate();
    var parent = graph.getDefaultParent();
	try{
//		var pt = graph.getFreeInsertPoint();
//		var x = pt.x;
//		var y = pt.y;
//		initCellsSytle(graph);
   		cells = graph.getImportableCells(cells);
   		//graph.getDefaultParent().node_type = node_type;/////dengcj注释暂时不用设置
        var model = graph.getModel();
        var node_type = cells[0].node_type;
        var mcell;
        var label = cells[0].value;
        var image = cells[0].image;
        //使用时候image4gray为上述定义
        console.log(node_type);
        graph.setConnectable(true);
        // if(node_type == 'select'){
        // 	//重新选择
        // 	graph.panningHandler.useLeftButtonForPanning = false;
			// graph.setConnectable(false);
			// toastrBoot(4,"不支持该操作!");
        // 	return;
        // }else if(node_type == 'zxline'){
        // 	//直线连接
        // 	graph.panningHandler.useLeftButtonForPanning = false;
			// graph.setConnectable(true);
        // 	connectEdge('strokeWidth=3;labelBackgroundColor=white;fontStyle=1');
        // 	toastrBoot(4,"不支持该操作!");
       	// 	return;
        // }else if(node_type == 'zjline'){
        // 	//直角连接
        // 	graph.panningHandler.useLeftButtonForPanning = false;
			// graph.setConnectable(true);
        // 	connectEdge('edgeStyle=orthogonalEdgeStyle;');
        // 	toastrBoot(4,"不支持该操作!");
        // 	return;
        // }else if(node_type == 'qxline'){
        // 	//曲线连接
        // 	graph.panningHandler.useLeftButtonForPanning = false;
			// graph.setConnectable(true);
        // 	connectEdge('edgeStyle=elbowEdgeStyle;elbow=horizontal;orthogonal=0;entryPerimeter=1;');
        // 	toastrBoot(4,"不支持该操作!");
        // 	return;
        // }else if(node_type == 'xxline'){
        // 	//虚线连接
        // 	graph.panningHandler.useLeftButtonForPanning = false;
			// graph.setConnectable(true);
        // 	connectEdge('crossover');
        // 	toastrBoot(4,"不支持该操作!");
        // 	return;
        // }

		/**
		 *
		 * 1.onOffOpen
		 *
		 **/
        // if(node_type == 'onOffOpen'){
			// var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(parent, null, label, xyArray[0], xyArray[1], 48, 48,'onOffOpen_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     // mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'onOffOpen_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        // 	////////////////////////////////以下为添加边界图片///////////////////////
        // 	/**
        // 	// 复写按钮图片
        //     var overlay = new mxCellOverlay(
        //         new mxImage('../view/pc/lc-view/lc-design/archive/grapheditor/images/activities/48/boundaryEventTime.png', 32, 32), '边界事件');
        //         // 在图形中覆盖
        //         graph.addCellOverlay(mcell, overlay);
        //         // 单击显示提示
        //         overlay.addListener(mxEvent.CLICK, function(sender, evt2){
        //             mxUtils.alert('单击');
        //         });
        //      overlay.cursor = 'hand';
			// 	 overlay.align = mxConstants.ALIGN_CENTER;
			// 	 console.info(overlay);
        //      // 复写按钮图片
        //      var overlay1 = new mxCellOverlay(
        //         new mxImage('../view/pc/lc-view/lc-design/archive/grapheditor/images/activities/48/exclusiveGatewayError.png', 32, 32), '错误');
        //         // 在图形中覆盖
        //         graph.addCellOverlay(mcell, overlay1);
        //         // 单击显示提示
        //         overlay1.addListener(mxEvent.CLICK, function(sender, evt2){
        //             mxUtils.alert('单击');
        //         });
        //     	///////////////////////////////////以上为添加边界事件图片/////////////////////////////
        //     	**/
        //         //双击显示提示
        // 		//graph.insertVertex(mcell, null, '边界事件', x, y, 32, 32,'start_image4gray;rounded=true;strokeColor=none;fillColor=yellow;');
        //     return;
        // }
        // /**
        //  *
        //  * 2.onOffClose
        //  *
        //  **/
        // else if(node_type == 'onOffClose'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(parent, null, label, x, y, 48, 48,'onOffClose_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        // /**
        //  *
        //  * 3.pilotLight
        //  *
        //  **/
        // else if(node_type == 'pilotLight'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'pilotLight_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        // /**
        //  *
        //  * 4.groundingCharacter
        //  *
        //  **/
        // else if(node_type == 'groundingCharacter'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'groundingCharacter_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        // /**
        //  *
        //  * 5.hystrix 熔断器
        //  *
        //  **/
        // else if(node_type == 'hystrix'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'hystrix_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        // /**
        //  *
        //  * 6.disconnectorClose 刀闸（2）-合
        //  *
        //  **/
        // else if(node_type == 'disconnectorClose'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'disconnectorClose_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        // /**
        //  *
        //  * 7.disconnectorClose 刀闸（2）-合
        //  *
        //  **/
        // else if(node_type == 'disconnectorOpen'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'disconnectorOpen_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        // /**
        //  *
        //  * 8.disconnector4close 刀闸（4）-合
        //  *
        //  **/
        // else if(node_type == 'disconnector4close'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'disconnector4close_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        // /**
        //  *
        //  * 9.disconnector4close 刀闸（4）-分
        //  *
        //  **/
        // else if(node_type == 'disconnector4open'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'disconnector4open_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        // /**
        //  *
        //  * 10.electricmotor 电动机
        //  *
        //  **/
        // else if(node_type == 'electricmotor'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'electricmotor_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        // /**
        //  *
        //  * 11.dynamo 发电机
        //  *
        //  **/
        // else if(node_type == 'dynamo'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'dynamo_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        // /**
        //  *
        //  * 12.inductance 电感
        //  *
        //  **/
        // else if(node_type == 'inductance'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'inductance_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        // /**
        //  *
        //  * 13.twosidetransformer3 两侧变压器3
        //  *
        //  **/
        // else if(node_type == 'twosidetransformer3'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'twosidetransformer3_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        // /**
        //  *
        //  * 14.twosidetransformer1 两侧变压器1
        //  *
        //  **/
        // else if(node_type == 'twosidetransformer1'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'twosidetransformer1_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        // /**
        //  *
        //  * 15.twosidetransformer1 两侧变压器1
        //  *
        //  **/
        // else if(node_type == 'twosidetransformer2'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'twosidetransformer2_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        // /**
        //  *
        //  * 16.onoffclose2 开关-2(关)
        //  *
        //  **/
        // else if(node_type == 'onoffclose2'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'onoffclose2_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        // /**
        //  *
        //  * 17.onoffopen2 开关-2(开)
        //  *
        //  **/
        // else if(node_type == 'onoffopen2'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'onoffopen2_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        // /**
        //  *
        //  * 18.TransformerThreephaseFivewireP 互感器-三相五线PT
        //  *
        //  **/
        // else if(node_type == 'TransformerThreephaseFivewireP'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'TransformerThreephaseFivewireP_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        // /**
        //  *
        //  * 19.TransformerThreePhaseCT 互感器-三相CT
        //  *
        //  **/
        // if(node_type == 'TransformerThreePhaseCT'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'TransformerThreePhaseCT_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        // /**
        //  *
        //  * 20.TransformerTwoPhaseCT 互感器-两相CT
        //  *
        //  **/
        // else if(node_type == 'TransformerTwoPhaseCT'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'TransformerTwoPhaseCT_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        // /**
        //  *
        //  * 21.TransformerSinglePhaseCT 互感器-单相CT
        //  *
        //  **/
        // else if(node_type == 'TransformerSinglePhaseCT'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'TransformerSinglePhaseCT_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        //
        //
        // /**
        //  *
        //  * 22.capacitance 电容
        //  *
        //  **/
        // else if(node_type == 'capacitance'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'capacitance_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        // /**
        //  *
        //  * 23.KnifeGate3open 刀闸-3(分)
        //  *
        //  **/
        // else if(node_type == 'KnifeGate3open'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'KnifeGate3open_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        //
        // /**
        //  *
        //  * 24.KnifeGate3close 刀闸-3(合)
        //  *
        //  **/
        // else if(node_type == 'KnifeGate3close'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'KnifeGate3close_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        // /**
        //  *
        //  * 25.Threephasetransformer2 三相变压器2
        //  *
        //  **/
        // else if(node_type == 'Threephasetransformer2'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'Threephasetransformer2_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        //
        // /**
        //  *
        //  * 26.Threephasetransformer3 三相变压器3
        //  *
        //  **/
        // else if(node_type == 'Threephasetransformer3'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'Threephasetransformer3_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        // /**
        //  *
        //  * 27.Threephasetransformer1 三相变压器1
        //  *
        //  **/
        // else if(node_type == 'Threephasetransformer1'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'Threephasetransformer1_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        // /**
        //  *
        //  * 28.Knifegate1close 刀闸-1(合)
        //  *
        //  **/
        // else if(node_type == 'Knifegate1close'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'Knifegate1close_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        // /**
        //  *
        //  * 29.Knifegate1open 刀闸-1(分)
        //  *
        //  **/
        // else if(node_type == 'Knifegate1open'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'Knifegate1open_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        // /**
        //  *
        //  * 30.transformer 互感器
        //  *
        //  **/
        // else if(node_type == 'transformer'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'transformer_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }
        //
        //
        // /**
        //  *
        //  * 31.electricreactor 电抗器
        //  *
        //  **/
        // else if(node_type == 'electricreactor'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'electricreactor_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }


        // /**
        //  *
        //  * 32.capacity 电容
        //  *
        //  **/
        // else if(node_type == 'capacity'){
        //     var xyArray = resultXy(x,y,graph,target);
        //     mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'capacity_image4gray;rounded=true;strokeColor=none;fillColor=yellow;verticalLabelPosition=bottom;verticalAlign=top');
        //     return;
        // }else{
        //     if(node_type != 'zxLine'){
        //         var imageStyle = new Object();
        //         imageStyle[mxConstants.STYLE_SHAPE] = mxConstants.SHAPE_IMAGE;
        //         imageStyle[mxConstants.STYLE_FONTSIZE] = '8';
        //         imageStyle[mxConstants.STYLE_FONTCOLOR] = '#000';
        //         imageStyle[mxConstants.STYLE_PERIMETER] = mxPerimeter.RectanglePerimeter;
        //         imageStyle[mxConstants.STYLE_IMAGE] = image;
        //         graph.getStylesheet().putCellStyle('imageStyle', imageStyle);
        //         var xyArray = resultXy(x,y,graph,target);
        //         mcell = graph.insertVertex(target, null, label, xyArray[0], xyArray[1], 48, 48,'imageStyle;rounded=true;strokeColor=none;verticalLabelPosition=bottom;verticalAlign=top');
        //
        //         if(null != mcell){
        //             mcell.node_type = node_type;
        //             mcell.nodeID = node_type+guid();
        //             mcell.value = label;
        //         }
        //         return true;
        //     }
        // }


	}finally{
		graph.getModel().endUpdate();
	}

    if(node_type == 'zxLine'){
        aminLine(graph,parent,x,y);
        return true;
    }

}
